---
title: Introduction
subtitle: Run continuous tasks and workflows with a long-lived browser session
slug: browser-sessions/introduction
---

## Why Browser Sessions?
Skyvern Browser Session is a way to persist the real-time state of the browser, so that any run can continue from where the previous run left off. Here are some scenarios when Skyvern Browser Session comes in handy:
- You have multiple continuous tasks that need to interact with the browser in real-time without much delay. For example, you are developing a phone agent for your customer support center and your agent needs access to real time information in the browser.
- You have several related tasks that may need to be executed but with interruptions in between. For example, you are developing an shopping agent that needs human in the loop to help fulfill the purchase.

Skyvern Browser Sessions are currently only available via [API & SDK](/api-reference/api-reference/browser-sessions/create-browser-session).

## Create a Browser Session
- [API doc](/api-reference/api-reference/browser-sessions/create-browser-session)

```python
from skyvern import Skyvern

skyvern = Skyvern(api_key="YOUR_API_KEY")
browser_session = await skyvern.create_browser_session(
	timeout=60,
)
```

- The `timeout` parameter (`>=5, <=10080`) is the max time in minutes that the browser session can run. By default, the timeout is 60 minutes.
- The `browser_session_id` the session ID you should note.

## Get A Browser Session
- [API doc](/api-reference/api-reference/browser-sessions/get-browser-session)

```python
from skyvern import Skyvern

skyvern = Skyvern(api_key="YOUR_API_KEY")
browser_session = await skyvern.get_browser_session(
	browser_session_id="YOUR_BROWSER_SESSION_ID",
)
```

## Close A Browser Session
- [API doc](/api-reference/api-reference/browser-sessions/close-browser-session)

```python
from skyvern import Skyvern

skyvern = Skyvern(api_key="YOUR_API_KEY")
await skyvern.close_browser_session(
	browser_session_id="YOUR_BROWSER_SESSION_ID",
)
```